#ifndef CARDPANEL_H
#define CARDPANEL_H

#include <QWidget>
#include<QPainter>
#include"card.h"
#include"player.h"
class CardPanel : public QWidget
{
    Q_OBJECT
public:
    explicit CardPanel(QWidget *parent = nullptr);

    //设置获取图片的函数
    void setImage(QPixmap&front,QPixmap &back);
    QPixmap getImage();

    bool getIsfront() const;
    void setIsfront(bool isfront);

    //记录窗口是否被选中了
    void setSeclected(bool flag);
    bool isSelected();
    //扑克牌的花色以及点数
    void setCard(Card&card);
    Card getCard();

    //扑克牌的拥有者

    Player *getOwner() const;
    void setOwner(Player *owner);



protected:
    void paintEvent(QPaintEvent*event);
    void mousePressEvent(QMouseEvent*event);
signals:

public slots:


private:
    QPixmap m_front;
    QPixmap m_back;
    bool m_isSelect;
    bool m_isfront;
    Card m_card;
    Player*m_owner;
};

#endif // CARDPANEL_H
